package com.cade.agriculturemall.view.personalCenter.help;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.cade.agriculturemall.InfoContentActivity;
import com.cade.agriculturemall.R;
import com.cade.agriculturemall.base.BaseActivity;
import com.cade.agriculturemall.base.IBasePresenter;

public class HelpActivity extends BaseActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_help);
        setupToolbar(true);
    }

    @Override
    public void setupView() {
    }

    private TextView tvIntro, tvVersion, tvPrivicy, tvUse;

    @Override
    public void setupEvent() {
        tvIntro = (TextView) findViewById(R.id.help_tv_info);
        tvVersion = (TextView) findViewById(R.id.help_tv_version);
        tvPrivicy = (TextView) findViewById(R.id.help_tv_privacy);
        tvUse = (TextView) findViewById(R.id.help_use_contract);
        tvIntro.setOnClickListener(this);
        tvVersion.setOnClickListener(this);
        tvPrivicy.setOnClickListener(this);
        tvUse.setOnClickListener(this);
    }

    @Override
    public void setupData() {

    }

    @Override
    public IBasePresenter setupPresenter() {
        return null;
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent(HelpActivity.this, InfoContentActivity.class);
        switch (view.getId()) {
            case R.id.help_tv_info:
                intent.putExtra("tittle", tvIntro.getText());
                intent.putExtra("content", "protocol.txt");
                intent.putExtra("type", 1);
                startActivity(intent);
                break;
            case R.id.help_tv_version:
                intent.putExtra("tittle", tvVersion.getText());
                intent.putExtra("content", "惠农 CopyRight @ 2003-现在，惠农农贸有限公司");
                intent.putExtra("type", 2);
                startActivity(intent);
                break;
            case R.id.help_use_contract:
                intent.putExtra("tittle", tvUse.getText());
                intent.putExtra("content", "use_contract.txt");
                intent.putExtra("type", 1);
                startActivity(intent);
                break;
            case R.id.help_tv_privacy:
                intent.putExtra("tittle", tvPrivicy.getText());
                intent.putExtra("content", "privacy.txt");
                intent.putExtra("type", 1);
                startActivity(intent);
                break;

        }
    }
}
